import math

digits = {'1':'one','2':'two','3':'three','4':'four','5':'five','6':'six','7':'seven','8':'eight','9':'nine','0':'zero'}
teens = {'0':'ten','1':'eleven','2':'twelve','3':'thirteen','4':'fourteen','5':'fifteen','6':'sixteen','7':'seventeen','8':'eighteen','9':'nineteen'}
tens = {'1':'ten','2':'twenty','3':'thirty','4':'forty','5':'fifty','6':'sixty','7':'seventy','8':'eighty','9':'ninety'}
places = ['hundred','thousand','million','billion','trillion']

def getwords(num):
	answer = ''
	working_num = str(num)
	place = math.ceil((len(working_num)/3))
	while place > 0:
		skip = 0
		end = -((place-1)*3)
		if end == 0:
			end = len(working_num)
		working_place = working_num[:end]
		working_num = working_num[end:]
		working_length = len(working_place)
		for x in range(working_length):
			digit = working_place[x]
			if (working_length-x) == 2 and digit != '0':
				if digit == '1':
					answer = answer + teens[working_place[x+1]]
					skip = 1
				else:
					answer = answer + tens[digit]
			elif digit != '0' and not skip:
				answer = answer + digits[digit]
			if (working_length-x) == 2:
				if working_place[x+1] != '0' and digit != '0':
					pass
#					answer = answer + '-'
			else:
				pass
#				answer = answer + ' '
			if (working_length-x) == 3:
				if working_place[0] != '0' or working_place[1] != '0' or working_place[2] != '0':
					answer = answer + 'hundred'
#				+ ' '
				if(working_place[x+1] != '0' or working_place[x+2] != '0'):
					answer = answer + 'and'
#					 + ' '
		if place > 1:
			answer = answer + places[place-1]
#			 + ', '
		place = place - 1
	return answer
letters = 0
for x in range(1,1001):
	print(getwords(x)+str(len(getwords(x))))
	letters = letters + len(getwords(x))
	
print(letters)